package database

import (
	_ "github.com/go-sql-driver/mysql"
	"tyjt-ferry/internal/config"
)

func Setup() {
	dbType := config.DataBaseConfig.Dbtype
	if dbType == "mysql" {
		var db = new(Mysql)
		db.Setup()
	}
}

func SetupIOC() {
	dbType := config.DataBaseConfig.Dbtype
	if dbType == "mysql" {
		Host := config.DataBaseConfig.Host
		Port := config.DataBaseConfig.Port
		Username := config.DataBaseConfig.Username
		Password := config.DataBaseConfig.Password
		Name := config.DataBaseConfig.Name

		db := NewMysqlIOC(dbType, Host, Port, Name, Username, Password)
		//d := NewMysqlIOC(DbType: dbType, )
		db.Setup()
	}
}
